<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="<%=request.getContextPath() %>/Hplus/favicon.ico"> 
    <link href="<%=request.getContextPath() %>/Hplus/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="<%=request.getContextPath() %>/Hplus/css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <!-- jqgrid-->
    <link href="<%=request.getContextPath() %>/Hplus/css/plugins/jqgrid/ui.jqgrid.css?0820" rel="stylesheet">

    <link href="<%=request.getContextPath() %>/Hplus/css/animate.css" rel="stylesheet">
    <link href="<%=request.getContextPath() %>/Hplus/css/style.css?v=4.1.0" rel="stylesheet">

    <style>
        /* Additional style to fix warning dialog position */

        #alertmod_table_list_2 {
            top: 900px !important;
        }
        
        .close{
        	position:relative;
        	background-color: red;
        	margin-top:-5px;
        	margin-right:-10px;
        	
        }
        
        .tabSpan{
        	background-color: #F4A460;
        	font-size:25px;
        	cursor:pointer;
        }
    </style>
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        
                    </div>
                    <div class="ibox-content">
                        <form method="get" class="form-horizontal">
                        	<input type="hidden" id="sql" value="${requestScope.sql }"/>
                        	<input type="hidden" id="tabSpanId" value="${requestScope.tabSpanId }">
                        	<div class="form-group">
						        <label class="col-sm-4 control-label">标识：</label>
						        <div class="col-sm-5">
						            <input type="text" id="tabSpanNo"  class="form-control" placeholder="请输入标识" value="${requestScope.curdListId }">
						        </div>
						    </div>
                        	
                            <div class="form-group">
						        <label class="col-sm-4 control-label">选择字段：</label>
						        <div class="col-sm-5">
						            <select id="filedSel" class="form-control">
						            	
						            </select>
						        </div>
						    </div>
						    
					    
                           
                           	<div class="form-group">
						        <label class="col-sm-4 control-label">列名：</label>
						        <div class="col-sm-5">
						            <input type="text" id="colName" class="form-control" placeholder="请输入列名" value="${requestScope.colName}"/>
						        </div>
						    </div>
                           
                           	<div class="form-group">
						        <label class="col-sm-4 control-label">位置：</label>
						        <div class="col-sm-5">
						            <input type="radio" name="tabPosition" value="left" <c:if test="${requestScope.pos == 'left' }">checked="checked"</c:if> />向左
						            <input type="radio" name="tabPosition" value="center" <c:if test="${requestScope.pos == 'center' }">checked="checked"</c:if>/>居中
						            <input type="radio" name="tabPosition" value="right" <c:if test="${requestScope.pos == 'right' }">checked="checked"</c:if>/>向右
						        </div>
						    </div>
						    
						    <div class="form-group">
						        <label class="col-sm-4 control-label">是否显示：</label>
						        <div class="col-sm-5">
						            <input type="radio" name="isShow" value="Y"/>显示
						            <input type="radio" name="isShow" value="N"/>不显示
						        </div>
						    </div>
						    
<!-- 						    <div class="form-group"> -->
<!-- 						        <label class="col-sm-4 control-label"></label> -->
<!-- 						        <div class="col-sm-5"> -->
<!-- 						            <button type="button" class="btn btn-primary" onclick="saveTabColInfo();">确定</button> -->
<!-- 						        </div> -->
<!-- 						    </div> -->
                        </form>
                    </div>
                    
                </div>
            </div>
        </div>
    </div>

    

    <!-- 全局js -->
    <script src="<%=request.getContextPath() %>/Hplus/js/jquery.min.js?v=2.1.4"></script>
    <script src="<%=request.getContextPath() %>/Hplus/js/bootstrap.min.js?v=3.3.6"></script>

    <!-- 自定义js -->
    <script src="<%=request.getContextPath() %>/Hplus/js/content.js?v=1.0.0"></script>

    <!-- iCheck -->
    <script src="<%=request.getContextPath() %>/Hplus/js/plugins/iCheck/icheck.min.js"></script>
    
    <script type="text/javascript" src="<%=request.getContextPath() %>/js/baseUI.js"></script>
    <script>
    
    	$(document).ready(function(){
    		getSelectInfo();
    	});
    
      	function getSelectInfo(){
      		var sql = $("#sql").val();
      		var url = "<%=request.getContextPath() %>/curdList/getColInfo";
      		$.ajax({
      			url:url,
      			type:"POST",
      			dataType:"json",
      			async:false,
      			data:{sql:sql},
      			success:function(data){
      				setSelectInfo(data);
      			}
      		});
      	}
      	
      	function setSelectInfo(data){
      		var selected = "${requestScope.tabColInfo}";
      		$("#filedSel").html("");
      		var html = "<option value=''>请选择</option>";
      		for(var i = 0; i < data.length; i++){
      			if(selected == data[i]){
      				html += "<option value='"+data[i]+"' selected='selected'>"+data[i]+"</option>"
      			}else{
      				html += "<option value='"+data[i]+"'>"+data[i]+"</option>";
      			}
      			
      		}
      		$("#filedSel").append(html);
      	}
      	
      	function save(){
      		var id = $("#tabSpanId").val();
      		
      		var tabSpanNo = $("#tabSpanNo").val();
      		var filedSel = $("#filedSel").val();
      		var colName = $("#colName").val();
      		var tabPosition=$('input:radio[name="tabPosition"]:checked').val();
      		var isShow=$('input:radio[name="isShow"]:checked').val();
      		
      		var params = tabSpanNo + "," + filedSel + "," +colName +  "," + tabPosition + "," + isShow;
      		
      		$("#"+id, window.parent.document).val(params);
      		
      		var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
            parent.layer.close(index);
      	}
    </script>

    <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
    <!--统计代码，可删除-->

</body>
</html>